package com.hlmedicals.app.system.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 部门机构表 ,医院和科室都使用此实体
 * 通过orgType来区分：1是医院，2是科室
 * @author  sszvip@qq.com
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "his_depart")
@Inheritance(strategy = InheritanceType.JOINED)
public class HisDepart extends IdEntityBase implements java.io.Serializable {
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "parentdepartid")
	private HisDepart parentDepart;//上级部门
	@Column(name = "departname", nullable = false, length = 100)
	private String departname;//名称
	@Column(name = "aptitudes", nullable = true, length = 10)
	private String aptitudes;// 资质
	@Column(name = "description", length = 500)
	private String description;//描述
	@Column(name = "org_code", length = 64)
    private String orgCode;//编码
    @Column(name = "org_type", length = 1)
    private String orgType;//机构编码,//1是医院2是科室
    @Column(name = "mobile", length = 32)
	private String mobile;//电话
	@Column(name = "fax", length = 32)
	private String fax;//传真
	@Column(name = "province_id", nullable = true, length = 32)
	private String province;//省份id
	@Column(name = "city_id", nullable = true, length = 32)
	private String city;//市区id
	@Column(name = "county_id", nullable = true, length = 32)
	private String county;//区县id
	@Column(name = "address", length = 100)
	private String address;//地址
   
	//这个属性是生成 控件用的,子部门(反射生成树形列表时用)
	@JsonIgnore
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "parentDepart")
	private List<HisDepart> hisDeparts = null;
	
	public List<HisDepart> getHisDeparts() {
		return hisDeparts;
	}

	public void setHisDeparts(List<HisDepart> hisDeparts) {
		this.hisDeparts = hisDeparts;
	}
	

	public HisDepart getParentDepart() {
		return this.parentDepart;
	}

	public void setParentDepart(HisDepart HisDepart) {
		this.parentDepart = HisDepart;
	}

	
	public String getDepartname() {
		return this.departname;
	}

	public void setDepartname(String departname) {
		this.departname = departname;
	}

	
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

   
    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

   
    public String getOrgType() {
        return orgType;
    }

    public void setOrgType(String orgType) {
        this.orgType = orgType;
    }

	
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}


	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}
	
	
	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}
	

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	
	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}


	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * 方法：取得 String
	 * 
	 * @return: String aptitudes
	 */
	public String getAptitudes() {
		return aptitudes;
	}

	/**
	 * 方法：设置String
	 * 
	 * @param: String aptitudes
	 */
	public void setAptitudes(String aptitudes) {
		this.aptitudes = aptitudes;
	}
}